<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">

    <h:head>
        <title>Пациент</title>
        <link type="text/css" rel="stylesheet" href="resources/css/default.css" />   
    </h:head>
    <h:body id="body">
        <table width="100%" border="1">
            <tr>
                <td width="100%">
                    <table width="100%" border="1" align="center">
                        <td align="center">
                            <ui:include src="fortop.xhtml"/>
                        </td>
                    </table>
                </td>
            </tr>
            <tr>
                <table width="100%" border="1" align="top" height="600px" >
                    <td width="15%" valign="top">
                        <ui:include src="left.xhtml"/>
                    </td>
                    <td width="75%" align="left" valign="top">
                        <table border="1" width="100%">
                            <td width="50%" valign="top">
                                <h:form id="pacient">
                                    <p:dataGrid id="ggg" var="pac" value="#{pacient.getPacientsWithStatus3()}" columns="1" paginator="true"  emptyMessage="Непринятых пациентов нет"
                                                paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" 
                                                paginatorPosition="bottom" style="border-radius: 10px;"  rows="10">
                                        <p:column>
                                            <p:commandButton style="width: 100%; text-align: left"  value="#{pac.lastName}  #{pac.name} #{pac.midName}" actionListener="#{pacient.pacientName(pac.name,pac.patientId)}" ajax="true" update=":inf" id="get"/>
                                            <p:blockUI block=":pacient" trigger="get" />
                                        </p:column>
                                    </p:dataGrid>                                    
                                </h:form>
                            </td>
                            <td width="50%" valign="top">
                                <h:form id="inf">
                                    <p:panel id="information" rendered="#{pacient.fl == 1}">
                                        <c:set value="${pacient.getPacientInfo()}" var="pacientInfo"/>
                                        <h:outputLabel for="name" value="Имя:"/><p:spacer width="5px"/>
                                        <h:outputText id="name" value="#{pacientInfo.name}"/><br/>
                                        <h:outputLabel for="midname" value="Фамилия:"/><p:spacer width="5px"/>
                                        <h:outputText id="midname" value="#{pacientInfo.midName}"/><br/>
                                        <h:outputLabel for="lastname" value="Отчество:"/><p:spacer width="5px"/>
                                        <h:outputText id="lastname" value="#{pacientInfo.lastName}"/><br/>
                                        <h:outputLabel for="adres" value="Адрес:"/><p:spacer width="5px"/>
                                        <h:outputText id="adres" value="#{pacientInfo.address}"/><br/>
                                        <h:outputLabel for="birthday" value="Д.Рождения:"/><p:spacer width="5px"/>
                                        <h:outputText id="birthday" value="#{pacientInfo.birthday}">
                                            <f:convertDateTime pattern="yyyy.MM.dd" />
                                        </h:outputText>
                                    </p:panel>
                                </h:form>
                            </td>

                        </table>
                    </td>
                </table>
            </tr>
        </table> 
    </h:body>
</html>

